#pragma once

#if defined(PRECOMIPLED_HEADER)
#include PRECOMPILED_HEADER
#else

#endif

#include <gl\glext.h>
#include <gl\wglext.h>

#define DECLARE_GLEXTENSIONS \
	PFNGLCREATEPROGRAMPROC glCreateProgram;\
	PFNGLDELETEPROGRAMPROC glDeleteProgram;\
	PFNGLCREATESHADERPROC glCreateShader;\
	PFNGLDELETESHADERPROC glDeleteShader;\
	PFNGLSHADERSOURCEPROC glShaderSource;\
	PFNGLCOMPILESHADERPROC glCompileShader;\
	PFNGLATTACHSHADERPROC glAttachShader;\
	PFNGLDETACHSHADERPROC glDetachShader;\
	PFNGLLINKPROGRAMPROC glLinkProgram;\
	PFNGLUSEPROGRAMPROC glUseProgram;\
	PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog;\
	PFNGLGETSHADERIVPROC glGetShaderiv;\
	PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation;\
	PFNGLUNIFORM1IPROC glUniform1i;\
	PFNGLUNIFORM1FPROC glUniform1f;\
	PFNGLACTIVETEXTUREPROC glActiveTexture;\
	PFNGLGETPROGRAMIVPROC glGetProgramiv;\
	PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog;\
	PFNGLVERTEXATTRIB1FPROC glVertexAttrib1f;\
	PFNGLVERTEXATTRIB2FPROC glVertexAttrib2f;\
	PFNGLGETATTRIBLOCATIONPROC glGetAttribLocation;\
	PFNGLBINDATTRIBLOCATIONPROC glBindAttribLocation;\
	PFNGLBINDBUFFERPROC glBindBuffer;\
	PFNGLBUFFERDATAPROC glBufferData;\
	PFNGLMAPBUFFERPROC glMapBuffer;\
	PFNGLUNMAPBUFFERPROC glUnmapBuffer;\
	PFNGLGENBUFFERSPROC glGenBuffers;\
	PFNGLDELETEBUFFERSPROC glDeleteBuffers;\
	PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer;\
	PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray;\
	PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray;\
	PFNGLGENVERTEXARRAYSPROC glGenVertexArrays;\
	PFNGLBINDVERTEXARRAYPROC glBindVertexArray;\
	PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays;\
	PFNGLUNIFORMMATRIX2FVPROC glUniformMatrix2fv;

#define DECLARE_EXTERN_GLEXTENSIONS \
	extern PFNGLCREATEPROGRAMPROC glCreateProgram;\
	extern PFNGLDELETEPROGRAMPROC glDeleteProgram;\
	extern PFNGLCREATESHADERPROC glCreateShader;\
	extern PFNGLDELETESHADERPROC glDeleteShader;\
	extern PFNGLSHADERSOURCEPROC glShaderSource;\
	extern PFNGLCOMPILESHADERPROC glCompileShader;\
	extern PFNGLATTACHSHADERPROC glAttachShader;\
	extern PFNGLDETACHSHADERPROC glDetachShader;\
	extern PFNGLLINKPROGRAMPROC glLinkProgram;\
	extern PFNGLUSEPROGRAMPROC glUseProgram;\
	extern PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog;\
	extern PFNGLGETSHADERIVPROC glGetShaderiv;\
	extern PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation;\
	extern PFNGLUNIFORM1IPROC glUniform1i;\
	extern PFNGLUNIFORM1FPROC glUniform1f;\
	extern PFNGLACTIVETEXTUREPROC glActiveTexture;\
	extern PFNGLGETPROGRAMIVPROC glGetProgramiv;\
	extern PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog;\
	extern PFNGLVERTEXATTRIB1FPROC glVertexAttrib1f;\
	extern PFNGLVERTEXATTRIB2FPROC glVertexAttrib2f;\
	extern PFNGLGETATTRIBLOCATIONPROC glGetAttribLocation;\
	extern PFNGLBINDATTRIBLOCATIONPROC glBindAttribLocation;\
	extern PFNGLBINDBUFFERPROC glBindBuffer;\
	extern PFNGLBUFFERDATAPROC glBufferData;\
	extern PFNGLMAPBUFFERPROC glMapBuffer;\
	extern PFNGLUNMAPBUFFERPROC glUnmapBuffer;\
	extern PFNGLGENBUFFERSPROC glGenBuffers;\
	extern PFNGLDELETEBUFFERSPROC glDeleteBuffers;\
	extern PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer;\
	extern PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray;\
	extern PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray;
	extern PFNGLGENVERTEXARRAYSPROC glGenVertexArrays;\
	extern PFNGLBINDVERTEXARRAYPROC glBindVertexArray;\
	extern PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays;\
	extern PFNGLUNIFORMMATRIX2FVPROC glUniformMatrix2fv;

#define GET_GLEXTENSION(func,func_big) func=(PFN##func_big##PROC)wglGetProcAddress(#func);

#define GET_GLEXTENSIONS \
	GET_GLEXTENSION(glCreateProgram,GLCREATEPROGRAM)\
	GET_GLEXTENSION(glDeleteProgram,GLDELETEPROGRAM)\
	GET_GLEXTENSION(glCreateShader,GLCREATESHADER)\
	GET_GLEXTENSION(glDeleteShader,GLDELETESHADER)\
	GET_GLEXTENSION(glShaderSource,GLSHADERSOURCE)\
	GET_GLEXTENSION(glCompileShader,GLCOMPILESHADER)\
	GET_GLEXTENSION(glAttachShader,GLATTACHSHADER)\
	GET_GLEXTENSION(glDetachShader,GLDETACHSHADER)\
	GET_GLEXTENSION(glLinkProgram,GLLINKPROGRAM)\
	GET_GLEXTENSION(glUseProgram,GLUSEPROGRAM)\
	GET_GLEXTENSION(glGetShaderInfoLog,GLGETSHADERINFOLOG)\
	GET_GLEXTENSION(glGetShaderiv,GLGETSHADERIV)\
	GET_GLEXTENSION(glGetUniformLocation,GLGETUNIFORMLOCATION)\
	GET_GLEXTENSION(glUniform1i,GLUNIFORM1I)\
	GET_GLEXTENSION(glActiveTexture,GLACTIVETEXTURE)\
	GET_GLEXTENSION(glUniform1f,GLUNIFORM1F)\
	GET_GLEXTENSION(glGetProgramiv,GLGETPROGRAMIV)\
	GET_GLEXTENSION(glGetProgramInfoLog,GLGETPROGRAMINFOLOG)\
	GET_GLEXTENSION(glGetAttribLocation,GLGETATTRIBLOCATION)\
	GET_GLEXTENSION(glVertexAttrib1f,GLVERTEXATTRIB1F)\
	GET_GLEXTENSION(glVertexAttrib2f,GLVERTEXATTRIB2F)\
	GET_GLEXTENSION(glBindAttribLocation,GLBINDATTRIBLOCATION)\
	GET_GLEXTENSION(glGenBuffers,GLGENBUFFERS)\
	GET_GLEXTENSION(glDeleteBuffers,GLDELETEBUFFERS)\
	GET_GLEXTENSION(glBindBuffer,GLBINDBUFFER)\
	GET_GLEXTENSION(glBufferData,GLBUFFERDATA)\
	GET_GLEXTENSION(glMapBuffer,GLMAPBUFFER)\
	GET_GLEXTENSION(glUnmapBuffer,GLUNMAPBUFFER)\
	GET_GLEXTENSION(glVertexAttribPointer,GLVERTEXATTRIBPOINTER)\
	GET_GLEXTENSION(glEnableVertexAttribArray,GLENABLEVERTEXATTRIBARRAY)\
	GET_GLEXTENSION(glDisableVertexAttribArray,GLDISABLEVERTEXATTRIBARRAY)\
	GET_GLEXTENSION(glGenVertexArrays,GLGENVERTEXARRAYS)\
	GET_GLEXTENSION(glBindVertexArray,GLBINDVERTEXARRAY)\
	GET_GLEXTENSION(glDeleteVertexArrays,GLDELETEVERTEXARRAYS)\
	GET_GLEXTENSION(glUniformMatrix2fv,GLUNIFORMMATRIX2FV)